#!/bin/bash

# MCP Forwarder 启动脚本

echo "Starting MCP Forwarder..."

# 检查Go是否安装
if ! command -v go &> /dev/null; then
    echo "Error: Go is not installed or not in PATH"
    exit 1
fi

# 检查依赖
if [ ! -f "go.mod" ]; then
    echo "Error: go.mod not found, please run in project root"
    exit 1
fi

# 安装依赖
echo "Installing dependencies..."
go mod tidy

# 创建数据目录
mkdir -p data

# 启动服务器
echo "Starting server on http://localhost:8080"
go run cmd/server/main.go